<template>
  <div class="son">
    <h1>我是Son组件（孙），我接收到了，{{car.name}}----{{car.price}}</h1>
  </div>
</template>

<script>
import {inject} from 'vue'
export default {
  name: "Son",
  setup(){
    let car=inject('car')
    console.log("car",car)
    return{car}
  }
}
</script>

<style scoped>
.son{
  background-color: pink;
  padding: 10px;
}
</style>
